package com.aaa.d01;

import com.aaa.d02.Point;

/**
 * @Author: whj
 * @Version 1.0
 * @Date: 2022/10/25  9:53
 */
public class Test {
    public static void main(String[] args){
        //坐标都是整数
        Point p1 = new Point(12,15);
        System.out.println(p1);

        //坐标都是小数
        Point p2 = new Point(12.5,15.5);
        System.out.println(p2);

        //坐标都是字符串
        Point p3 = new Point("东经223度","北纬123度 ");
        System.out.println(p3);

        //属性可以设置为字符串和整数---------就不符合题目要求
        Point p4 = new Point("东经223度",26);
        //java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
        //数据类型安全问题
        String x = (String) p4.getX();
        String y = (String) p4.getY();
        System.out.println(p4);
    }
}
